// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 6.14.2013
{$CLEO .cs}

//-------------MAIN---------------
0662: printstring "SCRIPT_AVTOWEAPONSELLER_BY_[_KRASH_]" 
0000: NOP 
thread "WEAPONSELL" 

:WEAPONSELL_56
wait 0 
if and
   not Actor.Driving($PLAYER_ACTOR)
   Player.Defined($PLAYER_CHAR)
jf @WEAPONSELL_56 
jump @WEAPONSELL_88 

:WEAPONSELL_88
if and
0AB0:   key_pressed 17 
0AB0:   key_pressed 76 
jf @WEAPONSELL_56 
if 
   Player.Money($PLAYER_CHAR) > 100
jf @WEAPONSELL_1398 
02A3: enable_widescreen 1 
Player.CanMove($PLAYER_CHAR) = False
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 
Player.Money($PLAYER_CHAR) += -100
jump @WEAPONSELL_159 

:WEAPONSELL_159
wait 0 
Model.Load(#BURRITO)
Model.Load(#CELLPHONE)
Model.Load(#FAM2)
Model.Load(#WMYAMMO)
06E9: load_car_component #WHEEL_SR3 
038B: load_requested_models 
wait 500 
if and
   Model.Available(#BURRITO)
   Model.Available(#CELLPHONE)
   Model.Available(#FAM2)
   Model.Available(#WMYAMMO)
04EE:   animation "PED" loaded 
jf @WEAPONSELL_159 
jump @WEAPONSELL_238 

:WEAPONSELL_238
wait 1000 
04C4: store_coords_to 3@ 4@ 5@ from_actor $PLAYER_ACTOR with_offset 5.0 5.0 0.0 
0208: 9@ = random_float_in_ranges -50.0 50.0 
0208: 10@ = random_float_in_ranges -50.0 50.0 
04C4: store_coords_to 6@ 7@ 8@ from_actor $PLAYER_ACTOR with_offset 9@ 10@ 0.0 
02C1: store_to 11@ 12@ 13@ car_path_coords_closest_to 6@ 7@ 8@ 
wait 6000 
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 
wait 1000 
Model.Destroy(#CELLPHONE)
fade 0 1500 
wait 1500 
28@ = Car.Create(#BURRITO, 6@, 7@, 8@)
0674: set_car_model 28@ numberplate "BY_KRASH" 
Car.DoorStatus(28@) = 2
01EC: make_car 28@ very_heavy 1 
Car.SetImmunities(28@, 1, 1, 1, 1, 1)
wait 100 
$MRK = Marker.CreateAboveCar(28@)
07E0: set_marker $MRK type_to 1 
06E7: $COMP = add_car_component #WHEEL_SR3 to_car 28@ 
0229: set_car 28@ primary_color_to 0 secondary_color_to 0 
30@ = Actor.CreateAsDriver(CivMale, #FAM2, 28@)
31@ = Actor.CreateAsPassenger(CivMale, #WMYAMMO, 28@, 1)
wait 100 
Actor.SetImmunities(30@, 1, 1, 1, 1, 1)
Actor.SetImmunities(31@, 1, 1, 1, 1, 1)
wait 100 
02C2: car 28@ drive_to 3@ 4@ 5@ 
Car.SetDriverBehaviour(28@, 5)
Car.SetMaxSpeed(28@, 50.0)
00AE: set_car 28@ traffic_behaviour_to 2 
0605: actor $PLAYER_ACTOR perform_animation "XPRESSSCRATCH" IFP "PED" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time 7000 
wait 1500 
fade 1 1500 
wait 4000 
Player.CanMove($PLAYER_CHAR) = True
02A3: enable_widescreen 0 

:WEAPONSELL_653
wait 100 
if 
00F4:   actor 30@ near_actor $PLAYER_ACTOR radius 10.0 10.0 0 in_car 
jf @WEAPONSELL_653 
Marker.Disable($MRK)
Car.SetDriverBehaviour(28@, Nowhere)
Car.SetSpeedInstantly(28@, 0.0)
wait 1000 
Car.DoorStatus(28@) = 2
Car.LockInCurrentPosition(28@) = True
wait 2000 
0407: store_coords_to 25@ 26@ 27@ from_car 28@ with_offset 0.0 -3.0 0.0 
0657: car 28@ open_door 4 
0657: car 28@ open_door 5 

:WEAPONSELL_777
wait 0 
if and
   Player.Defined($PLAYER_CHAR)
0102:   actor $PLAYER_ACTOR in_sphere 25@ 26@ 27@ radius 1.0 1.0 1.0 sphere 1 stopped_on_foot 
jf @WEAPONSELL_777 
Model.Load(#COLT45)
Model.Load(#DESERT_EAGLE)
Model.Load(#TEC9)
Model.Load(#MICRO_UZI)
Model.Load(#MP5LNG)
Model.Load(#CHROMEGUN)
Model.Load(#SAWNOFF)
Model.Load(#AK47)
17@ = 500 
18@ = 1900 
19@ = 600 
20@ = 800 
21@ = 2500 
22@ = 600 
23@ = 1000 
24@ = 4000 
Player.CanMove($PLAYER_CHAR) = False
0512: show_permanent_text_box 'WPNS' 
0581: enable_radar 0 
08D4: $MENU = create_panel_with_title 'WPNS' position 29.0 170.0 width 300.0 columns 2 interactive 1 background 1 alignment 1 
08DB: set_panel $MENU column 0 header 'DUMMY' data '9MM' 'DGL' 'TEC' 'UZI' 'SMG' 'STGN' 'SAWN' 'AK47' 'BB' 'DUMMY' 'DUMMY' 'DUMMY' 
08D6: set_panel $MENU column 1 alignment 1 
08EE: set_panel $MENU column 1 row 0 text_1number GXT 'DOLLAR' number 17@ 
08EE: set_panel $MENU column 1 row 1 text_1number GXT 'DOLLAR' number 18@ 
08EE: set_panel $MENU column 1 row 2 text_1number GXT 'DOLLAR' number 19@ 
08EE: set_panel $MENU column 1 row 3 text_1number GXT 'DOLLAR' number 20@ 
08EE: set_panel $MENU column 1 row 4 text_1number GXT 'DOLLAR' number 21@ 
08EE: set_panel $MENU column 1 row 5 text_1number GXT 'DOLLAR' number 22@ 
08EE: set_panel $MENU column 1 row 6 text_1number GXT 'DOLLAR' number 23@ 
08EE: set_panel $MENU column 1 row 7 text_1number GXT 'DOLLAR' number 24@ 
09DB: set_panel $MENU column 0 width 240 
09DB: set_panel $MENU column 1 width 70 

:WEAPONSELL_1311
wait 0 
if 
00E1:   player 0 pressed_key 16 
jf @WEAPONSELL_1347 
08D7: 0@ = panel $MENU active_row 
gosub @WEAPONSELL_1672 

:WEAPONSELL_1347
wait 0 
if 
00E1:   player 0 pressed_key 15 
jf @WEAPONSELL_1311 
0581: enable_radar 1 
03E6: remove_text_box 
08DA: remove_panel $MENU 
Player.CanMove($PLAYER_CHAR) = True
wait 1000 
jump @WEAPONSELL_777 

:WEAPONSELL_1398
03D6: remove_styled_text 'NMNY2' 
00BC: show_text_highpriority GXT 'NMNY2' time 3000 flag 1 
jump @WEAPONSELL_56 

:WEAPONSELL_1432
wait 100 
Car.LockInCurrentPosition(28@) = False
02A3: enable_widescreen 1 
wait 1000 
0581: enable_radar 1 
03E6: remove_text_box 
08DA: remove_panel $MENU 
0512: show_permanent_text_box 'HND' 
068A: set_car 28@ repair_door 3 
068A: set_car 28@ repair_door 4 
02C2: car 28@ drive_to 6@ 7@ 8@ 
Car.SetDriverBehaviour(28@, FollowRoad)
Car.SetMaxSpeed(28@, 120.0)
00AE: set_car 28@ traffic_behaviour_to 2 
wait 10000 
03E6: remove_text_box 
Player.CanMove($PLAYER_CHAR) = True
02A3: enable_widescreen 0 
wait 10000 
Car.SetImmunities(28@, 0, 0, 0, 0, 0)
Car.SetDriverBehaviour(28@, Nowhere)
Car.Destroy(28@)
Actor.DestroyInstantly(30@)
Actor.DestroyInstantly(31@)
wait 1000 
Car.RemoveReferences(28@)
Actor.RemoveReferences(31@)
Actor.RemoveReferences(30@)
Model.Destroy(#BURRITO)
Model.Destroy(#WMYAMMO)
Model.Destroy(#FAM2)
Model.Destroy(#COLT45)
Model.Destroy(#DESERT_EAGLE)
Model.Destroy(#TEC9)
Model.Destroy(#MICRO_UZI)
Model.Destroy(#MP5LNG)
Model.Destroy(#CHROMEGUN)
Model.Destroy(#SAWNOFF)
Model.Destroy(#AK47)
06EB: release_car_component #WHEEL_SR3 
jump @WEAPONSELL_56 

:WEAPONSELL_1672
2@ = Player.Money($PLAYER_CHAR)
if 
  0@ == 0 
jf @WEAPONSELL_1758 
if 
002D:   2@ >= 17@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, Pistol, 50)
1@ = 0 
0062: 1@ -= 17@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_1758
if 
  0@ == 1 
jf @WEAPONSELL_1836 
if 
002D:   2@ >= 18@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, DesertEagle, 30)
1@ = 0 
0062: 1@ -= 18@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_1836
if 
  0@ == 2 
jf @WEAPONSELL_1914 
if 
002D:   2@ >= 19@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, Tec9, 60)
1@ = 0 
0062: 1@ -= 19@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_1914
if 
  0@ == 3 
jf @WEAPONSELL_1992 
if 
002D:   2@ >= 20@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, MicroUzi, 90)
1@ = 0 
0062: 1@ -= 20@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_1992
if 
  0@ == 4 
jf @WEAPONSELL_2070 
if 
002D:   2@ >= 21@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, MP5, 120)
1@ = 0 
0062: 1@ -= 21@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_2070
if 
  0@ == 5 
jf @WEAPONSELL_2148 
if 
002D:   2@ >= 22@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, Shotgun, 35)
1@ = 0 
0062: 1@ -= 22@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_2148
if 
  0@ == 6 
jf @WEAPONSELL_2226 
if 
002D:   2@ >= 23@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, Sawnoff, 30)
1@ = 0 
0062: 1@ -= 23@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_2226
if 
  0@ == 7 
jf @WEAPONSELL_2305 
if 
002D:   2@ >= 24@ // (int) 
jf @WEAPONSELL_2332 
00BE: text_clear_all 
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, AK47, 150)
1@ = 0 
0062: 1@ -= 24@ // (int) 
Player.Money($PLAYER_CHAR) += 1@
jump @WEAPONSELL_2359 

:WEAPONSELL_2305
if 
  0@ == 8 
jf @WEAPONSELL_1672 
03E6: remove_text_box 
jump @WEAPONSELL_1432 

:WEAPONSELL_2332
03D6: remove_styled_text 'NMNY' 
00BC: show_text_highpriority GXT 'NMNY' time 3000 flag 1 

:WEAPONSELL_2359
return 
